<template>
  <div>
    <!-- 当子组件不存在时，调用卸载函数 -->
    <Person v-if="isShow"/>
  </div>
</template>

<script lang="ts" setup name="App">
import Person from './components/Person.vue'
import {ref} from "vue"
import {onMounted} from "vue"
let isShow=ref(true)
// 挂载完毕
onMounted(() => {
  console.log("父组件挂载完毕"); 
})
</script>


<style>

</style>